﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<PagedList<PaperSystem.Models.ExamUserInfo>>" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc"%>
<%@ Import Namespace="PaperSystem.Models"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>考过试卷《<%=(ViewData["paperInfo"] as Paper).Title%>》的考生信息</title>
    <link type="text/css" href="/Content/common.css" rel="Stylesheet" />
    <style type="text/css">
        .col_id, .col_time, .col_name, .col_correct{height:100%;text-align:center;}
    </style>
</head>
<body>
    <%Paper paper = ViewData["paperInfo"] as Paper; %>
    <div class="page_container">
	<div class="page_left">
		<div class="page_left_inner">
			<h1 class="left_logo"><a href="#" class="logo" title="试题库系统">试题库系统</a></h1>
			<%if (ViewData["userName"] != null){%>
			    <div class="left_message">欢迎您，<br/><%=ViewData["userName"]%>老师<br /><a href="/Login/Logout/" class="logout">退出</a></div>
			<%} %>
			<ul class="left_nav">
				<li><a href="/Question/QuestionList">题库管理</a></li>
				<li><a href="/Paper/PaperList">试卷管理</a></li>
				<li class="current"><a href="/Paper/PaperCorrectList1">改卷</a></li>
				<li><a href="/Statistics/PaperList">统计</a></li>
			</ul>
		</div>
	</div>
	<!-- end page_left -->
	<div class="page_center">
		<div class="page_center_inner">
			<h2>考过试卷《<%=(ViewData["paperInfo"] as Paper).Title%>》的考生信息</h2>
			<div class="tab_container">	
			    <div class="tab_content">
				    <div class="tab_content_inner">
				        <form id="form1" action="/Paper/PaperCorrectList2" style="display:inline;">
				            <label>批改状态:</label><%=Html.DropDownList("isCorrected", ViewData["Corrected"] as SelectList, "全部") %>
                            <label>学号:</label><%=Html.TextBox("userId") %>
                            <label>考生姓名:</label><%=Html.TextBox("sName") %>
                            <input type="hidden" name="pid" value="<%=ViewData["paperId"] %>" />
                            <a href="#" onclick="document.getElementById('form1').submit();" class="btn_blue">查找</a>
                            <a href="/Paper/PaperCorrectList1" class="btn_gray">返回</a>
				        </form>
				    </div>
			    </div>
			</div>
			<!-- end tab_container -->
			<!-- content begin here -->
			<div class="table_container">
			    <table id="infoTable">
			        <thead>
			            <tr>
			                <th class="col_id" width="25%">学号</th>
			                <th class="col_name" width="25%">考生姓名</th>
			                <th class="col_time" width="25%">做卷时间</th>
			                <th class="col_correct" width="25%">是否批改过</th>
			            </tr>
			        </thead>
			        <tbody>
			            <% foreach (var item in Model)
                          { %>
                            <tr>
                                <td class="col_id"><%=Html.DisplayFor(modelItem => item.userId)%></td>
                                <td class="col_name"><%=Html.DisplayFor(modelItem => item.sName)%></td>
                                <td class="col_time"><%=Html.DisplayFor(modelItem => item.beginTime)%></td>
                                <td class="col_correct"><%=Html.DisplayFor(modelItem => item.isCorrected)%></td>
                            </tr>
			            <%} %>
			        </tbody>
			    </table>
			    <%=Html.Pager(Model, new PagerOptions { PageIndexParameterName = "page", PrevPageText = "上一页", NextPageText = "下一页", ShowFirstLast = false, CurrentPagerItemWrapperFormatString = "<span class=\"cur_page_wrap page_wrap\">{0}</span>", NumericPagerItemWrapperFormatString = "<span class=\"page_wrap\">{0}</span>", NavigationPagerItemWrapperFormatString = "<span class=\"page_nav\">{0}</span>", CssClass = "pages clearfix", SeparatorHtml = "" })%>
			</div>
			<!-- content end here -->
		</div>
	</div>
	<!-- end page_center -->
</div>

<script type="text/javascript" src="/Scripts/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="/Scripts/common.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        //点击每行选中该行
        var objTable = $('#infoTable');
        var pid = $('#form1 input[name=pid]').val();
        objTable.on('click', 'tr:gt(0)', function(event) {
            var tr = $(this);
            var userId = tr.find('.col_id').text();
            var time = tr.find('.col_time').text();
            var isCorrrected = tr.find('.col_correct').text();
            location.href = '/Paper/PaperCorrect?pid=' + pid + '&userId=' + userId + '&beginTime=' + time;
        })
        .on('mouseenter', 'tr:gt(0)', function(event) {
            $(this).addClass('hover');
        })
        .on('mouseleave', 'tr:gt(0)', function(event) {
            $(this).removeClass('hover');
        });

    });
</script>
</body>
</html>
